﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MShop.Core.DataAccess;
using MShop.Core.Util;
using System.Collections;

using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace MShop.Core.Configuration
{
    [Serializable]
    public class ShopCfgSettings
    {


        public string[] GetWebSiteHotKey()
        {
            if (!string.IsNullOrEmpty(WebSiteHotKeys))
            {
                if (WebSiteHotKeys.IndexOf(",") != -1)
                {
                    return WebSiteHotKeys.Split(new char[] { ',' });
                }
                else
                {
                    return new string[] { WebSiteHotKeys };
                   
                }
            }
            return new string[] { };
        }


        public ShopCfgSettings()
        {
            PerPoint = 1;
            this.WebSiteHotKeysSearchPath = "/Search?key={0}";
        } 

        [DisplayName("网站标题")]
        public string WebSiteTitle { get; set; }

        [DisplayName("网站名称")]
        public string WebSiteName { get; set; }

        [DataType(DataType.MultilineText)]
        [DisplayName("热门关键字")]
        public string WebSiteHotKeys { get; set; }


        [DisplayName("热门关键字搜索页面路径")]
        public string WebSiteHotKeysSearchPath { get; set; }


        [DisplayName("网站客户代码")]
        public string WebSiteCustomerService { get; set; }

        [UIHint("img")]
        [DisplayName("网站Logo")]
        public string WebSiteLogo { get; set; }

        [DisplayName("网站域名")]
        public string WebSiteUrl { get; set; }

         [DataType(DataType.MultilineText)]
        [DisplayName("首页关键字")]
        public string WebSiteKeyWords { get; set; }


        [DataType(DataType.MultilineText)]
        [DisplayName("首页描述")]
        public string WebSiteDescription { get; set; }

        [DisplayName("许可密匙")]
        public string WebSiteLicenseKey { get; set; }

        [DataType(DataType.MultilineText)]
        [DisplayName("注册协议")]
        public string WebSiteRegisterLicense { get; set; }


        [DataType(DataType.MultilineText)]
        [DisplayName("网站安全")]
        public string WebSiteSafeLink { get; set; }

        [DataType(DataType.MultilineText)]
        [DisplayName("网站版权")]
        public string WebSiteCopyRight { get; set; }

        [DisplayName("ICP证")]
        public string WebSiteICP { get; set; }

        [DisplayName("管理员QQ")]
        public string WebSiteQQ { get; set; }

        [DisplayName("公司名称")]
        public string WebSiteCompany { get; set; }
      

        [DisplayName("管理员地址")]
        public string WebSiteAddress { get; set; }

        [DisplayName("管理员电话")]
        public string WebSitePhone { get; set; }

        [DisplayName("管理员邮件")]
        public string WebSiteEmail { get; set; }

        [DisplayName("管理员传真")]
        public string WebSiteFax { get; set; }

        [DataType(DataType.MultilineText)]
        [DisplayName("过滤字符")]
        public string WebSiteFilterWords { get; set; }

        [DataType(DataType.MultilineText)]
        [DisplayName("页面底部")]
        public string WebSiteFooter { get; set; }

        [DisplayName("分页页数")]
        public int WebSitePageSize { get; set; }

        [DisplayName("积分/货币")]
        public decimal PerPoint { get; set; } 

        [DisplayName("SMTP服务器地址")]
        public string SmtpServier { get; set; }
        [DisplayName("SMTP服务器端口")]
        public int Port { get; set; }
        [DisplayName("SMTP邮箱")]
        public string Email { get; set; }
        [DisplayName("是否启用SSL")]
        public bool SSL { get; set; }
        [DisplayName("SMTP用户名")]
        public string UserName { get; set; }
        [DisplayName("SMTP用户密码")]
        [DataType(DataType.Password)]
        public string Password { get; set; }

        [DisplayName("当前区域")]
        public string ClutureName { get; set; }

        [DisplayName("当前货币")]
        public int CurrencyId { get; set; }

        [DisplayName("会员默认角色")]
        public Guid RoleId { get; set; }


        [DisplayName("缩略图宽度")]
        public int ImageWidth { get; set; }
        [DisplayName("缩略图高度")]
        public int ImageHeight { get; set; }

        [DisplayName("水印文本")]
        public string WaterMarkText { get; set; }

        [UIHint("img")]
        [DisplayName("水印图片")]
        public string WaterMarkImage { get; set; }

        [UIHint("WaterMarkControl")]
        [DisplayName("水印类型")]
        public WaterMarkType WaterMarkType { get; set; }

        [DisplayName("透明度")]
        public int Alpha { get; set; } 
        

     

    }

    public enum WaterMarkType
    {
        Text,
        Image
    }
}